home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -serious- / programming / other / tandem / teaching / 29.asm < prev    next >
Assembly Source File  |  1999-09-06  |  4KB  |  106 lines

  1. * 29.asm    TLReqarea,TLReqbev   version 0.01    2.10.98
  2.  
  3.  
  4. ; This program relies on placing boxes of particular sizes at particular
  5. ; places. You get better at positioning display elements with practice.
  6. ; Incidentally, most programmers think it's bad practice to put numbers
  7. ; in your actual program lines; rather it is better practice to use
  8. ; symbolic names, which are all given values in a series of EQU pseudo-ops
  9. ; at the start of your program. Also, most programmers use more "white
  10. ; space" (blank lines, spread out lines) in their programs than I do.
  11.  
  12. ; You should read the docs in Tandem.guide for TLreqbev and TLreqarea
  13. ; carefully, as it relates to the program below. Notice also how
  14. ; TLReqarea & TLReqbev "clip" boxes & area which go past the printable
  15. ; area of the window. If you write on the window border it (or beyond it!)
  16. ; it looks terrible, and can crash the system.
  17.  
  18. ; The below are examples of a new art form - making artistic combinations
  19. ; of bevelled boxes. Note that the plain rectangles have double width
  20. ; sides, which look better than single width.
  21.  
  22.  
  23.  include 'Front.i'        ; *** change to 'Tandem.i to step thru TL's ***
  24.  
  25.  
  26. strings: dc.b 0
  27. st_1: dc.b 'Demonstrate TLReqarea & TLReqbev',0 ;1
  28.  dc.b 'Error: out of chip memory',0 ;2
  29.  dc.b 'A plain bevelled box   A recessed bevelled box   A plain rectangle',0
  30.  dc.b 'A bevelled box with custom pens   A rectangle with custom pen',0 ;4
  31.  dc.b 'A plain bevelled box filled with pen 3    40X1  1X15  2X15',0 ;5
  32.  dc.b 'Clipped boxes',0 ;6
  33.  dc.b 'Combinations (Art?) ... ',0 ;7
  34.  
  35.  ds.w 0
  36.  
  37.  
  38. * test program
  39. Program:
  40.  TLwindow #0,#0,#0,#640,#200,#640,#200,#0,#st_1 ;open window 0
  41.  bne.s Pr_cont
  42.  TLbad #2                  ;report if can't open window
  43.  rts
  44.  
  45. Pr_cont:
  46.  TLstring #3,#6,#3                 ;top three boxes
  47.  TLreqbev #66,#18,#40,#15          ;  plain
  48.  TLreqbev #258,#18,#40,#15,rec     ;  recessed
  49.  TLreqbev #450,#18,#40,#15,box     ;  rectangle
  50.  
  51.  TLstring #4,#6,#44                ;second row of boxes
  52.  TLreqbev #106,#59,#40,#15,,,#3,#6 ;  bev, pens 5,6
  53.  TLreqbev #366,#59,#40,#15,box,,#3 ;  rect, pen 3
  54.  
  55.  TLstring #5,#6,#85                ;third row
  56.  TLreqarea #130,#100,#40,#15,#3    ;  fill with pen 3
  57.  TLreqbev #130,#100,#40,#15        ;  plain bev
  58.  TLreqbev #342,#100,#40,#1,box     ;  40X1
  59.  TLreqbev #392,#100,#1,#15,box     ;  1X15
  60.  TLreqbev #440,#100,#2,#15,box     ;  2X15
  61.  
  62.  move.l xxp_AcWind(a4),a5          ;clipped boxes
  63.  moveq #0,d6
  64.  moveq #0,d7
  65.  move.w xxp_PWidth(a5),d6
  66.  move.w xxp_PHeight(a5),d7
  67.  sub.w #104,d6
  68.  sub.w #40,d7
  69.  TLstring #6,d6,d7
  70.  add.w #84,d6
  71.  add.w #12,d7
  72.  TLreqbev d6,d7,#40,#15            ;clipped horz
  73.  add.w #20,d7
  74.  TLreqbev d6,d7,#40,#15            ;clipped both
  75.  sub.w #46,d6
  76.  TLreqbev d6,d7,#40,#15            ;clipped vert
  77.  
  78.  TLstring #7,#6,#126               ;fourth row
  79.  TLreqbev #6,#136,#60,#30          ;  1st
  80.  TLreqbev #7,#137,#58,#28
  81.  TLreqbev #76,#136,#60,#30,rec     ;  2nd
  82.  TLreqbev #77,#137,#58,#28,rec
  83.  TLreqbev #146,#136,#60,#30        ;  3rd
  84.  TLreqbev #148,#137,#56,#28,rec
  85.  TLreqbev #216,#136,#60,#30,rec    ;  4th
  86.  TLreqbev #218,#137,#56,#28
  87.  TLreqarea #286,#136,#60,#20,#3    ;  5th
  88.  TLreqbev #286,#136,#60,#20
  89.  TLreqarea #292,#139,#48,#14
  90.  TLreqbev #292,#139,#48,#14,rec
  91.  TLreqarea #286,#161,#60,#20,#3    ;  6th
  92.  TLreqbev #286,#161,#60,#20
  93.  TLreqarea #292,#164,#48,#14
  94.  TLreqbev #292,#164,#48,#14,rec
  95.  TLreqbev #293,#165,#46,#12,rec
  96.  TLreqarea #366,#141,#40,#20,#3    ;7th
  97.  TLreqbev #366,#141,#40,#20
  98.  TLreqarea #376,#146,#40,#20
  99.  TLreqbev #376,#146,#40,#20
  100.  TLreqbev #366,#141,#32,#16,box
  101.  TLreqarea #356,#136,#40,#20
  102.  TLreqbev #356,#136,#40,#20
  103.  
  104.  TLkeyboard                        ;wait for response
  105.  rts
  106.